<template>
  <div class="cus-tabs">
    <Tabs :value="value" @on-click="onClick">
      <TabPane :label="val.name" :name="`${ind}`" v-for="(val,ind) in list" :key="ind">
        <slot :name="ind"></slot>
      </TabPane>
    </Tabs>
  </div>
</template>

<script>
  export default {
    name: "cus-tabs",
    props: {
      value: {
        type: String,
        default: ''
      },
      list: {
        type: Array,
        default: () => {
          return []
        }
      }
    },
    methods: {
      onClick(name) {
        this.$emit('update:value', name);
        this.$emit('onChange')
      }
    }
  }
</script>

<style scoped>

</style>
